<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <form name="editForm" role="form" novalidate v-on:submit.prevent="save()">
        <h2 id="roomAdminApp.roomUserBrokerChantMessage.home.createOrEditLabel" data-cy="RoomUserBrokerChantMessageCreateUpdateHeading">
          Create or edit a RoomUserBrokerChantMessage
        </h2>
        <div>
          <div class="form-group" v-if="roomUserBrokerChantMessage.id">
            <label for="id">ID</label>
            <input type="text" class="form-control" id="id" name="id" v-model="roomUserBrokerChantMessage.id" readonly />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-message">Message</label>
            <input
              type="text"
              class="form-control"
              name="message"
              id="room-user-broker-chant-message-message"
              data-cy="message"
              :class="{ valid: !$v.roomUserBrokerChantMessage.message.$invalid, invalid: $v.roomUserBrokerChantMessage.message.$invalid }"
              v-model="$v.roomUserBrokerChantMessage.message.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-status">Status</label>
            <input
              type="number"
              class="form-control"
              name="status"
              id="room-user-broker-chant-message-status"
              data-cy="status"
              :class="{ valid: !$v.roomUserBrokerChantMessage.status.$invalid, invalid: $v.roomUserBrokerChantMessage.status.$invalid }"
              v-model.number="$v.roomUserBrokerChantMessage.status.$model"
            />
            <div v-if="$v.roomUserBrokerChantMessage.status.$anyDirty && $v.roomUserBrokerChantMessage.status.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomUserBrokerChantMessage.status.max">
                This field cannot be longer than 1 characters.
              </small>
              <small class="form-text text-danger" v-if="!$v.roomUserBrokerChantMessage.status.numeric">
                This field should be a number.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-messageType">Message Type</label>
            <input
              type="text"
              class="form-control"
              name="messageType"
              id="room-user-broker-chant-message-messageType"
              data-cy="messageType"
              :class="{
                valid: !$v.roomUserBrokerChantMessage.messageType.$invalid,
                invalid: $v.roomUserBrokerChantMessage.messageType.$invalid,
              }"
              v-model="$v.roomUserBrokerChantMessage.messageType.$model"
            />
            <div v-if="$v.roomUserBrokerChantMessage.messageType.$anyDirty && $v.roomUserBrokerChantMessage.messageType.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomUserBrokerChantMessage.messageType.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-sendId">Send Id</label>
            <input
              type="number"
              class="form-control"
              name="sendId"
              id="room-user-broker-chant-message-sendId"
              data-cy="sendId"
              :class="{ valid: !$v.roomUserBrokerChantMessage.sendId.$invalid, invalid: $v.roomUserBrokerChantMessage.sendId.$invalid }"
              v-model.number="$v.roomUserBrokerChantMessage.sendId.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-receiveId">Receive Id</label>
            <input
              type="number"
              class="form-control"
              name="receiveId"
              id="room-user-broker-chant-message-receiveId"
              data-cy="receiveId"
              :class="{
                valid: !$v.roomUserBrokerChantMessage.receiveId.$invalid,
                invalid: $v.roomUserBrokerChantMessage.receiveId.$invalid,
              }"
              v-model.number="$v.roomUserBrokerChantMessage.receiveId.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-createdBy">Created By</label>
            <input
              type="text"
              class="form-control"
              name="createdBy"
              id="room-user-broker-chant-message-createdBy"
              data-cy="createdBy"
              :class="{
                valid: !$v.roomUserBrokerChantMessage.createdBy.$invalid,
                invalid: $v.roomUserBrokerChantMessage.createdBy.$invalid,
              }"
              v-model="$v.roomUserBrokerChantMessage.createdBy.$model"
            />
            <div v-if="$v.roomUserBrokerChantMessage.createdBy.$anyDirty && $v.roomUserBrokerChantMessage.createdBy.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomUserBrokerChantMessage.createdBy.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-createdDate">Created Date</label>
            <div class="d-flex">
              <input
                id="room-user-broker-chant-message-createdDate"
                data-cy="createdDate"
                type="datetime-local"
                class="form-control"
                name="createdDate"
                :class="{
                  valid: !$v.roomUserBrokerChantMessage.createdDate.$invalid,
                  invalid: $v.roomUserBrokerChantMessage.createdDate.$invalid,
                }"
                :value="convertDateTimeFromServer($v.roomUserBrokerChantMessage.createdDate.$model)"
                @change="updateInstantField('createdDate', $event)"
              />
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-lastModifiedBy">Last Modified By</label>
            <input
              type="text"
              class="form-control"
              name="lastModifiedBy"
              id="room-user-broker-chant-message-lastModifiedBy"
              data-cy="lastModifiedBy"
              :class="{
                valid: !$v.roomUserBrokerChantMessage.lastModifiedBy.$invalid,
                invalid: $v.roomUserBrokerChantMessage.lastModifiedBy.$invalid,
              }"
              v-model="$v.roomUserBrokerChantMessage.lastModifiedBy.$model"
            />
            <div v-if="$v.roomUserBrokerChantMessage.lastModifiedBy.$anyDirty && $v.roomUserBrokerChantMessage.lastModifiedBy.$invalid">
              <small class="form-text text-danger" v-if="!$v.roomUserBrokerChantMessage.lastModifiedBy.maxLength">
                This field cannot be longer than 32 characters.
              </small>
            </div>
          </div>
          <div class="form-group">
            <label class="form-control-label" for="room-user-broker-chant-message-lastModifiedDate">Last Modified Date</label>
            <div class="d-flex">
              <input
                id="room-user-broker-chant-message-lastModifiedDate"
                data-cy="lastModifiedDate"
                type="datetime-local"
                class="form-control"
                name="lastModifiedDate"
                :class="{
                  valid: !$v.roomUserBrokerChantMessage.lastModifiedDate.$invalid,
                  invalid: $v.roomUserBrokerChantMessage.lastModifiedDate.$invalid,
                }"
                :value="convertDateTimeFromServer($v.roomUserBrokerChantMessage.lastModifiedDate.$model)"
                @change="updateInstantField('lastModifiedDate', $event)"
              />
            </div>
          </div>
        </div>
        <div>
          <button type="button" id="cancel-save" data-cy="entityCreateCancelButton" class="btn btn-secondary" v-on:click="previousState()">
            <font-awesome-icon icon="ban"></font-awesome-icon>&nbsp;<span>Cancel</span>
          </button>
          <button
            type="submit"
            id="save-entity"
            data-cy="entityCreateSaveButton"
            :disabled="$v.roomUserBrokerChantMessage.$invalid || isSaving"
            class="btn btn-primary"
          >
            <font-awesome-icon icon="save"></font-awesome-icon>&nbsp;<span>Save</span>
          </button>
        </div>
      </form>
    </div>
  </div>
</template>
<script lang="ts" src="./room-user-broker-chant-message-update.component.ts"></script>
